import pymysql

serverName='localhost'
userName='root'
passWord='0'
db='roam'
conn = pymysql.connect(host=serverName, port=3306, user=userName, passwd=passWord, db=db , charset='utf8')
cursor = conn.cursor()
sqlkey = "INSERT INTO `roam`.`scenic_release_info`(`scenic_release_id`, `scenic_release_title`, `scenic_release_text`, `scenic_release_good`, `space_release_time`, `space_release_type`, `scenic_id`, `user_id`, `ano_user`) VALUES "
for i in range(31,33):
    scenic_release_id =str(i)
    scenic_release_title="title"+str(i)
    scenic_release_text="scenic_release_text"+str(i)
    scenic_release_good=str(i)
    space_release_type=str(1)
    scenic_id="1"
    user_id=str(i)
    ano_user="0"
    sqlv="(%s, %s, %s, %s, '2021-11-08 15:29:08', %s, %s, %s, %s)"
    cursor.execute(sqlkey+sqlv, (scenic_release_id, scenic_release_title,scenic_release_text,scenic_release_good,space_release_type,scenic_id,user_id,ano_user))
    conn.commit()
print("执行完成")
conn.close()
cursor.close()